<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>计数器</title>
</head>


<body>
    <div id="app">
        
    </div>
</body>
<script src="https://unpkg.com/vue@next"></script>
<script>
    const app = {
       template:`
       <div>
        <div><input value="hello"/></div>
        <div><input v-focus value="hello"/></div>
        </div>
       `
    }
    app.directive('focus',{
        mounted(el){//当被绑定的元素挂载到DOM中时
            el.focus();//聚焦函数
        }

    })
    Vue.createApp(app).mount("#app");
</script>

</html>